<template>
<slot :controller="controller" :store="store" :model="model">
    <div :class="classNames">
        <slot name="container_scroll1Container" :controller="controller" :store="store" :model="model" >
        <AppScrollContainer 
            name="container_scroll1"
            :layoutModelDetails="store.layoutModelDetails">
            <template #container_scroll_main1>
                <slot name="container_scroll_main1Container" :controller="controller" :store="store" :model="model" >
                <AppScrollContainer 
                    name="container_scroll_main1"
                    :layoutModelDetails="store.layoutModelDetails">
                    <template #nav_pos1>
                        <slot name="nav_pos1" :controller="controller" :store="store" :model="model" >
                        <AppNavPos 
                            name="nav_pos1"
                            :layoutModelDetails="store.layoutModelDetails"
                            :navData="store.layoutModelDetails['nav_pos1']?.navData"/>
                        </slot>
                    </template>
                </AppScrollContainer>
                </slot>
            </template>
            <template #container_scroll_header1>
                <slot name="container_scroll_header1Container" :controller="controller" :store="store" :model="model" >
                <AppScrollContainer 
                    name="container_scroll_header1"
                    :layoutModelDetails="store.layoutModelDetails">
                    <template #container_grid1>
                        <slot name="container_grid1Container" :controller="controller" :store="store" :model="model" >
                        <AppSimpleFlexContainer 
                            name="container_grid1"
                            :layoutModelDetails="store.layoutModelDetails">
                            <template #container1>
                                <slot name="container1Container" :controller="controller" :store="store" :model="model" >
                                <AppSimpleFlexContainer 
                                    name="container1"
                                    :layoutModelDetails="store.layoutModelDetails">
                                    <template #view_pagecaption>
                                        <slot name="view_pagecaption" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                                        <AppPresetCaption 
                                            v-if="model.showCaption && !noViewCaption"
                                            name="view_pagecaption"
                                            @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                            :layoutModelDetails="store.layoutModelDetails">
                                            {{model.caption}}
                                        </AppPresetCaption>
                                        </slot>
                                    </template>
                                </AppSimpleFlexContainer>
                                </slot>
                            </template>
                            <template #container2>
                                <slot name="container2Container" :controller="controller" :store="store" :model="model" >
                                <AppSimpleFlexContainer 
                                    name="container2"
                                    :layoutModelDetails="store.layoutModelDetails">
                                </AppSimpleFlexContainer>
                                </slot>
                            </template>
                        </AppSimpleFlexContainer>
                        </slot>
                    </template>
                </AppScrollContainer>
                </slot>
            </template>
            <template #container_scroll_left1>
                <slot name="container_scroll_left1Container" :controller="controller" :store="store" :model="model" >
                <AppScrollContainer 
                    name="container_scroll_left1"
                    :layoutModelDetails="store.layoutModelDetails">
                    <template #gridexpbar>
                        <slot name="gridexpbar" :controller="controller" :store="store" :model="model"  :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                        <AppCtrlPos name="gridexpbar" :layoutModelDetails="store.layoutModelDetails">
                            <slot name="IBIZOrderTestCustomLayoutPanelGridExpViewgridexpbarGridExpBar" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                            <IBIZOrderTestCustomLayoutPanelGridExpViewgridexpbarGridExpBar
                                ref="CalendarExpBar"
                                :openView="store.openView"
                                :newView="store.newView"
                                name="gridexpbar"
                                v-bind="model.ctrlParams.IBIZOrdergridexpbar"
                                :context="store.context"
                                :viewParams="store.viewParams"
                                :closeView="store.closeView"
                                :pLoadingHelper="store.loadingHelper"
                                :pViewCtx="store.viewCtx"
                                @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                                @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                                @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }">
                            </IBIZOrderTestCustomLayoutPanelGridExpViewgridexpbarGridExpBar>
                            </slot>
                            </AppCtrlPos>
                        </slot>
                    </template>
                </AppScrollContainer>
                </slot>
            </template>
        </AppScrollContainer>
        </slot>
    </div>
</slot>
</template>
<script lang="ts" setup>
// 基于template/src/views/{{appModules}}/{{pages@DEGRIDEXPVIEW}}/{{spinalCase page.codeName}}-base.vue.hbs生成
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';

import IBIZOrderTestCustomLayoutPanelGridExpViewgridexpbarGridExpBar from '@widgets/ibiz-order/test-custom-layout-panel-grid-exp-viewgridexpbar-grid-exp-bar/test-custom-layout-panel-grid-exp-viewgridexpbar-grid-exp-bar.vue';
import { useProps, useBasic, useAction, useController } from './ibiz-order-test-custom-layout-panel-grid-exp-view-hook';
import { IEvent, GridExpViewActionType, IGridExpViewAbility, IGridExpViewStore, IParam } from '@/core';

// 输入参数
const props = defineProps(useProps());

//  导航分隔值
const split = ref(0.3);

// 基础数据
const { 
    model,
    getClassNames, 
    useNavParamsBind,
	useEventBind,
    handleQuickSearch,
  	handleToolbarItemClick,
    handleComponentAction,
	handleCtrlAction,
	handleCtrlInit,
	handleCtrlDestroy,
    initSplit,
    handleSplitChange,
    handleQuickGroupValueChange
} = useBasic(props);

const emit = defineEmits<{
    (event: 'view-action', name: string, action: GridExpViewActionType, data: IParam[]): void;
    (event: 'view-init', name: string, data: IGridExpViewAbility): void;
    (event: 'view-mounted', name: string, data: IParam): void;
    (event: 'view-destroy', name: string, data: IParam): void;
}>();

const evt = useEventBind(emit);
const classNames = computed(() => {
  	return getClassNames(props);
});

// 初始化控制器
const controller = useController(props, evt);

useNavParamsBind(controller, props);

const store: IGridExpViewStore = controller.getStore();

onMounted(() => {
    controller.viewMounted();
    initSplit(getCurrentInstance());
})

onUnmounted(() => {
    controller.viewDestroy();
})
</script>